Animal = {}

function Animal:New(init)
  self.__index = self
  o = setmetatable({},self)
  o.init = init
  return self 
end
function Animal.print()
  print("Animal.print")
end


Dog = Animal:New() 
--这里不会觉得怪嘛？明明是Animal的实例 却用 Dog 命名
function Dog.print()
  print("Dog.print")
end

Dog.print()

BlackDog = Dog:New()
function BlackDog.print()
  print("BlackDog.print")
end

BlackDog.print()




